<?php TPL::output('global/header.tpl.htm'); ?>

<div class="i_bd mainElem i_clear ">
           <div class="i_left L_sidebar b_restrain">
           	<h3 class="latest_trendst_h3 q_qusAll i_prl q_content_h3 ">
           	<?php if ($this->user_id) { ?>
                <p class="q_navC i_pas" id="topic">
                  <a href="javascript:;" >已关注</a>
                  <a href="javascript:;" class="cur">广场</a>
                </p>
            <?php } ?>
                标签
            </h3>
          <div>
          <div id="topic_1" >
           <?php if ($this->today_topic) { ?>
              <p class="topic_today i_gloCor">今日标签</p>
              <div class="t_topic_index i_prl topic_title_main">
                
                <h3><b><?php echo $this->today_topic['topic_title']; ?></b> </h3>
                <p class="i_txtBreak i_cl_01 i_bdted"><?php echo nl2br(cjk_substr($this->today_topic['topic_description'], 0, 128, 'UTF-8', '...')); ?><a href="topic/<?php echo $this->today_topic['url_token']; ?>">进入标签 »</a></p>
                <a class="u_topicHead i_pas"><img title="<?php echo $this->today_topic['topic_title']; ?>" alt="<?php echo $this->today_topic['topic_title']; ?>" class="i_radiu5" src="<?php echo get_topic_pic_url('max', $this->today_topic['topic_pic']); ?>"></a> 
                
                <ul class="list">
                		<?php if ($this->today_topic['action_list']) { ?>
                		<?php foreach ($this->today_topic['action_list'] AS $key => $val) { ?>
                        <li>
                            <span class="replys i_right"><?php echo $val['answer_count']; ?> 个回复</span>
                            <span class="txt_link i_gltxtHide"><a href="question/<?php echo $val['question_id']; ?>#reply<?php echo $val['answer_count']; ?>"><?php echo $val['question_content']; ?></a></span>
                        </li>
                        <?php } ?>
                        <?php } ?>
                        <?php if ($this->today_topic['best_answer_users']) { ?>
                        <li>
                            <span class="user_x2 i_right">擅长者：
                            <?php foreach ($this->today_topic['best_answer_users'] AS $key => $val) { ?>
                            	<a href="people/<?php echo $val['user_info']['url_token']; ?>"><img data-message="&uid=<?php echo $val['user_info']['uid']; ?>&card=user" class="i_radiu3 user_msg" alt="jinshuo" src="<?php echo get_avatar_url($val['user_info']['uid'], 'mid'); ?>"></a>
                            <?php } ?>		
                            </span>
                            <!--<p class="i_glotxtClass user_x3 i_prl"><input  type="text" value="该站点相关的站点..." onfocus="$.topic.akQues(this);" class="txt_x2"/><a href="javascript:;" class="askQuestion i_pas i_radiu3">发问</a></p>-->
                    </li>
                    <?php } ?>
                </ul>
                </div>
                <?php } ?>
                <p class="topic_today i_gloCor x2">推荐标签</p>
                <?php foreach ($this->related_topics AS $key => $val) { ?>
                <div class="m_gzTopic i_prl m_recommend_topic i_radiu5">
                	<p><a class="i_glotopic" href="topic/<?php echo $val['url_token']; ?>"><?php echo $val['topic_title']; ?></a></p>
                    <div class="i_cl_03 i_bdted tx2">
                    	<p class="i_txtBreak tx3"><?php echo nl2br(cjk_substr($val['topic_description'], 0, 128, 'UTF-8', '...')); ?><a href="topic/<?php echo $val['url_token']; ?>">标签详情 »</a>
                    	<p class="tx4 i_cl_02"><span><?php echo $val['discuss_count']; ?> 个站点</span>&nbsp;&nbsp;<span><?php echo $val['focus_count']; ?> 人关注</span></p>
                    </div>
                    <?php if ($val['related_topics']) { ?>
                    <p class="tx">相关标签: 
                	<?php foreach ($val['related_topics'] AS $related_key => $related_val) { ?>
                        <a href="topic/<?php echo $related_val['url_token']; ?>" class="i_glotopic user_msg" data-message="&uid=<?php echo $related_val['topic_id']; ?>&card=topic"><?php echo $related_val['topic_title']; ?></a>
                    <?php } ?>
                    </p>
                    <?php } ?>
                    
                     <a class="u_topicHead i_pas" href="topic/<?php echo $val['url_token']; ?>"><img title="<?php echo $val['topic_title']; ?>" alt="<?php echo $val['topic_title']; ?>" class="i_radiu5" src="<?php echo get_topic_pic_url('max', $val['topic_pic']); ?>"></a>
                </div>
                <?php } ?>
                
                <p class="topic_today i_gloCor">全部标签</p>
                <ul class="pri_letter i_clear t_hot mg_topic_mdan" id="c_topics_list"></ul>
                
                <p id="bp_topics_more"><a class="i_ajax_more" href="javascript:;">更多...</a></p>
                
                <script type="text/javascript">
                	$(document).ready(function () {
	                	bp_more_load(G_BASE_URL + '/topic/ajax/topics_list/', $('#bp_topics_more'), $('#c_topics_list'));
                	});
                </script>
              </div>
              <div id="topic_0" style="display:none;">  
                <?php if ($this->user_id) { ?>
                <p class="topic_today i_gloCor">我关注的标签</p>
                
                <div id="c_focus_list"></div>
                
                <p id="bp_focus_more"><a class="i_ajax_more" href="javascript:;">更多...</a></p>
                
                <script type="text/javascript">
                	$(document).ready(function () {
	                	bp_more_load(G_BASE_URL + '/topic/ajax/focus_list/', $('#bp_focus_more'), $('#c_focus_list'));
                	});
                </script>
                <?php } ?>
              </div>
           </div>
     </div><!--end L_sidebar div-->
            
     <div class="R_sidebar">
              <div class="i_rightMain">
                <div class="topic_hrx">
                	<h3 class="i_gloCor">热门标签</h3>
                    <div class="topic_x3">
                    	<ul class="topic_x4">
                    		<?php foreach ($this->hot_topics AS $key => $val) { ?>
                    		<li><em<?php if ($key + 1 <= 3) { ?> class="top"<?php } ?>><?php echo ($key + 1); ?></em><a data-message="&uid=<?php echo $val['topic_id']; ?>&card=topic" class="i_glotopic user_msg" href="topic/<?php echo $val['url_token']; ?>"><?php echo $val['topic_title']; ?></a></li>
                    		<?php } ?>
                         </ul>                       
                    </div>
                    
                    <h3 class="i_gloCor">标签编辑</h3>
                     <div class="topic_edits">
                     	<?php if ($this->edit_log) { ?>
                     	<?php foreach ($this->edit_log AS $key => $val) { ?>
                     	<a data-message="&uid=<?php echo $val['topic_info']['topic_id']; ?>&card=topic" class="i_glotopic user_msg" href="topic/<?php echo $val['topic_info']['url_token']; ?>"><?php echo $val['topic_info']['topic_title']; ?></a>
                        <p><a href="people/<?php echo $val['user_info']['url_token']; ?>" data-message="&uid=<?php echo $val['user_info']['uid']; ?>&card=user" class="user_msg"><?php echo $val['user_info']['user_name']; ?></a> <?php echo date_friendly($val['add_time']); ?> 编辑了该标签</p>
                        <?php } ?>
                        <?php } ?>
                     </div>
                     
                     <?php if ($this->unedit_topics) { ?>
                     <h3 class="i_gloCor">待编辑标签</h3>
                     <div class="topic_edits">
                     	<?php foreach ($this->unedit_topics AS $key => $val) { ?>
                     	<a data-message="&uid=<?php echo $val['topic_id']; ?>&card=topic" class="i_glotopic user_msg" href="topic/<?php echo $val['url_token']; ?>"><?php echo $val['topic_title']; ?></a>
                        <?php } ?>
                     </div>
                     <?php } ?>
                </div>
                
              </div>
        </div>
     

</div>

<script type="text/javascript">
	$.tabs('#topic'); //标签广场切换
	//$.tabs('#topic_banner');//全部站点切换
</script>

<?php TPL::output('global/footer.tpl.htm'); ?>